package com.example.demo.pattern.factory.abstraces;

/**
 * 抽象工厂模式   抽象工厂类用户产生特定的工厂类
 * 功能接口  功能接口实现类
 */
public class FactoryPruduce {

    public static AbstractFactory getFactory(String factoryType){
        if (factoryType == null) return null;
        if (factoryType.equalsIgnoreCase("shape")){
            return new ShapeFactory();
        }else if (factoryType.equalsIgnoreCase("color")){
            return new ColorFactory();
        }else{
            return null;
        }
    }
}
